<?
class AppBaseController extends Zend_Controller_Action
{
	public $limit = 30;
	public $request;
	public $form;
	public $controller;
	public $action;
	public $usuario;
	public static $session = "";
	private $projeto = "";
	public $base = "/certificadospp";
	public $titulo = "Certificado SPP";
	
	public function init()
	{
		$this->__getUrlAction();		
		
		$this->view->controller = $this->controller;
		$this->view->titulo     = $this->titulo;
		$this->view->base	    = $this->base;
	}

	public function __getUrlAction()
	{
		$parans = $this->_request->getParams();
		$url    = '';
		
		foreach ($parans as $key => $value)
		{
			if($key == 'module')
			{
				$value = ($value == 'default')?'':$value.'/';
				$url   = $value .$url;
				
				continue;
			}
			else if($key == 'controller')
			{
				$url .= $value.'/';
								
				$this->controller = $value;
			
				continue;
			}
			else if($key == 'action')
			{
				$url .= $value.'/';
				
				$this->action = $value;
				
				continue;
			}
			else if($key == 'pagina')
				continue;
			$url .= $key.'/'.$value.'/';
		}

		return $url;
	}
}
?>